from django.urls import path
from .views import (ArticleList, ArticleDetail, CategoryList, CategoryDetail, TagList, TagDetail)

urlpatterns = [
    # 文章接口，用slug访问详情
    path('articles/', ArticleList.as_view(), name='article-list'),
    path('articles/<str:id>/<slug:slug>/', ArticleDetail.as_view(), name='article-detail'),

    # 分类接口，用slug访问详情
    path('categories/', CategoryList.as_view(), name='category-list'),
    path('categories/<str:id>/<slug:slug>/', CategoryDetail.as_view(), name='category-detail'),

    # 标签接口，用slug访问详情
    path('tags/', TagList.as_view(), name='tag-list'),
    path('tags/<str:id>/<slug:slug>/', TagDetail.as_view(), name='tag-detail'),
]
